﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="PeriodosViewModify.aspx.cs" Inherits="Recursos.View.PeriodosViewModify" %>
<%@ Register TagPrefix="cc1" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit, Version=4.1.60919.0, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>Modificar Periodo</h2>
<asp:ScriptManager ID="ScriptManager" runat="server" EnableScriptGlobalization="true" EnableScriptLocalization="true">
            </asp:ScriptManager>
<asp:GridView ID="GridView1" runat="server" CellPadding="3" GridLines="Horizontal"
   Font-Names="Verdana" Font-Size="10" DataKeyNames="id" OnRowDataBound="gridView_RowDataBound"
   AutoGenerateColumns="false" onrowcancelingedit="GridView1_RowCancelingEdit" 
        onrowediting="GridView1_RowEditing" onrowupdating="GridView1_RowUpdating" 
        Width="1150px"  onrowdeleting="GridView1_RowDeleting">
   
   <HeaderStyle BackColor="#336699" ForeColor="White" HorizontalAlign="Left" Height="25" />            
            
   <Columns>
     <asp:CommandField ButtonType="Button" ShowEditButton="true" EditText="Editar" CancelText="Cancelar" ShowCancelButton="true"  UpdateText="Actualizar"/>
                    
      <asp:TemplateField >
        <ItemTemplate>
            <asp:Button ID="deleteButton" runat="server" CommandName="Delete" Text="Eliminar"
            OnClientClick="return confirm('Está seguro de que desea eliminar el periodo?');" />
        </ItemTemplate>
      </asp:TemplateField> 

      <asp:BoundField DataField="id" HeaderText="" ReadOnly="true" Visible="False" />

      <asp:TemplateField HeaderText="Fecha Inicio" >
          <ItemTemplate>
              <%# Eval("FechaInicio", "{0:dd/MM/yyyy}")%>
          </ItemTemplate>
          <EditItemTemplate>
             
             <asp:TextBox ID="TextBox1" Text='<%# Eval("FechaInicio", "{0:dd/MM/yyyy}")%>' runat="server"  Height="23px" 
            Width="90px"></asp:TextBox>
                  
 <cc1:CalendarExtender ID="CalendarExtender1" PopupButtonID="Image1"
runat="server" TargetControlID="TextBox1"  Format="dd/MM/yyyy"/>

              <asp:Image   
                  ID="Image1"  
                  runat="server"  
                  ImageUrl="~/img/calendar.png"  
                  />  
                    <asp:RegularExpressionValidator id="RegularExpressionValidator2" runat="server" ErrorMessage="RegularExpressionValidator"  
                        ControlToValidate="TextBox1"  ForeColor="red"
                        ValidationExpression="^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((1[6-9]|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((1[6-9]|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((1[6-9]|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$">Formato de fecha dd/MM/aaaa</asp:RegularExpressionValidator></td>
            
          </EditItemTemplate>
      </asp:TemplateField>                     
      
      <asp:TemplateField HeaderText="Fecha Final">
          <ItemTemplate>
            <%# Eval("FechaFinal", "{0:dd/MM/yyyy}")%>
          </ItemTemplate>
          <EditItemTemplate>
            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Eval("FechaFinal", "{0:dd/MM/yyyy}")%>'  Height="23px" 
            Width="90px"></asp:TextBox>
            <cc1:CalendarExtender ID="CalendarExtender2" PopupButtonID="Image2"
runat="server" TargetControlID="TextBox2"  Format="dd/MM/yyyy"/>

              <asp:Image   
                  ID="Image2"  
                  runat="server"  
                  ImageUrl="~/img/calendar.png"  
                  />  
           <asp:RegularExpressionValidator id="RegularExpressionValidator3" runat="server" ErrorMessage="RegularExpressionValidator"  
                        ControlToValidate="TextBox2"  ForeColor="red"
                        ValidationExpression="^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((1[6-9]|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((1[6-9]|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])\/02\/((1[6-9]|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$">Formato de fecha dd/MM/aaaa</asp:RegularExpressionValidator></td>
                   

 </EditItemTemplate>
      </asp:TemplateField>         
      <asp:TemplateField HeaderText="Periodo">
          <ItemTemplate>
              <%# Eval("NumeroPeriodo")%>
          </ItemTemplate>
          <EditItemTemplate>
                     <asp:DropDownList ID="DropDownListPeriodo" runat="server" Height="18px" Width="50px">
          <asp:ListItem>1</asp:ListItem>
                <asp:ListItem>2</asp:ListItem>
                <asp:ListItem>3</asp:ListItem>
                <asp:ListItem>4</asp:ListItem>
                <asp:ListItem>5</asp:ListItem>
                <asp:ListItem>6</asp:ListItem>
                <asp:ListItem>7</asp:ListItem>
                <asp:ListItem>8</asp:ListItem>
                <asp:ListItem>9</asp:ListItem>
                <asp:ListItem>10</asp:ListItem>
                <asp:ListItem>11</asp:ListItem>
                <asp:ListItem>12</asp:ListItem>
        </asp:DropDownList>
          </EditItemTemplate>
      </asp:TemplateField>
      <asp:TemplateField HeaderText="Modalidad">
          <ItemTemplate>
              <%# Eval("TipoPeriodo.Nombre")%>
          </ItemTemplate>
          <EditItemTemplate>
             <asp:DropDownList ID="DropdownModalidad" runat="server" DataValueField="id"  DataTextField="Nombre" />
          </EditItemTemplate>
      </asp:TemplateField>      
 
      
    <asp:TemplateField HeaderText="Año" >
          <ItemTemplate>
              <%# Eval("Año")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:TextBox runat="server" ID="año" Text='<%# Eval("Año")%>' Width="100px" />
               <asp:CompareValidator ID="cv" runat="server" ControlToValidate="año" Type="Integer" ForeColor="red"
   Operator="DataTypeCheck" ErrorMessage="El año debe ser numero entero. " />
             </EditItemTemplate>
      </asp:TemplateField>  
                <asp:TemplateField HeaderText="Días hábiles" >
          <ItemTemplate>
              <%# Eval("DiasHabiles")%>
          </ItemTemplate>
          <EditItemTemplate>
              <asp:TextBox runat="server" ID="diashabiles" Text='<%# Eval("DiasHabiles")%>' Width="50px" />
                <asp:CompareValidator ID="cv2" runat="server" ControlToValidate="diashabiles" Type="Integer" ForeColor="red"
   Operator="DataTypeCheck" ErrorMessage="Los dias deben ser numero entero. " />
             </EditItemTemplate>
      </asp:TemplateField>  
   

     

    </Columns>










            
</asp:GridView>

</asp:Content>
